<?php
/**
 * Created by PhpStorm.
 * User: 13469
 * Date: 2018/12/8
 * Time: 10:32
 */

include "config.php";
if(isset($_REQUEST["id"])){
    $CID=$_REQUEST["id"];
    $sql="SELECT  *FROM `cart` WHERE c_id=?";
    $stmt=$conn->prepare($sql);
    $stmt->bind_param("i",$CID);
    $stmt->execute();
    $res=$stmt->get_result();
    //print_r($res);
    $arr=array();
    while($row=$res->fetch_assoc()){
                array_push($arr,$row);
            };
            print_r(json_encode($arr));
}


// $arr=array();
// if($res->num_rows>=1){
//     while($row=$res->fetch_assoc()){
//         array_push($arr,$row);
//     };
// };
// print_r(json_encode($arr));